#include "stdafx.h"
#include "../aclib/HexParser.h"

namespace AC = AppliedCryptography;
using ::testing::Return;

TEST(HexParser, LowerCaseStr)
{
	AC::HexParser p;
	std::vector<byte> bytes;
	std::string str("00010203050607080a0b0c0d0f101112");
	std::string str2;

	bytes = p.Encode(str);
	str2 = p.Decode(bytes);

	EXPECT_TRUE(str.compare(str2) == 0);
};

TEST(HexParser, UpperCaseStr)
{
	AC::HexParser p;
	std::vector<byte> bytes;
	std::string str("00010203050607080A0B0C0D0F101112");
	std::string str2;

	bytes = p.Encode(str);
	p.SetUpperCaseMode(true);
	str2 = p.Decode(bytes);

	EXPECT_TRUE(str.compare(str2) == 0);
};
